﻿using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace Shared.ToDo.Dtos
{
    public class BaseDto : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        public void RaisePropertyChanged([CallerMemberName] string propertyName = "")
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }

        private DateTime createTime;
        private DateTime updateTime;
        private int id;

        public DateTime CreateTime
        {
            get
            {
                return createTime;
            }
            set
            {
                createTime = value;
                RaisePropertyChanged();
            }
        }

        public DateTime UpdateTime
        {
            get
            {
                return updateTime;
            }
            set
            {
                updateTime = value;
                RaisePropertyChanged();
            }
        }

        public int ID
        {
            get
            {
                return id;
            }
            set
            {
                id = value;
                RaisePropertyChanged();
            }
        }
    }
}
